package com.kqb.sgadmin.utils;

import cn.hutool.crypto.digest.BCrypt;

/**
 * 密码加密 使用sa-token BCrypt
 *
 * @author 杉果树皮
 */
public class PwdUtils {


    public static String bcryptPasswordEncoder(String pwd) {
        return BCrypt.hashpw(pwd, BCrypt.gensalt());
    }

    public static boolean checkPwd(String pwd, String hash) {
        return BCrypt.checkpw(pwd, hash);
    }
}
